<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('销售统计列表')" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
         <div class="col-sm-12" style="font-weight: bold; font-size: 16px;">月账单查询</div>
         <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>账期：</label>
                                <select name="accountMonth" id="accountMonth" class="form-control m-b" >
                                    <option value="">所有</option>
                                    <option th:each="dict : ${accountMonth}" th:text="${dict}" th:value="${dict}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: select2-js" />
     <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var prefix = ctx + "business/count";

        $(function() {
            var options = {
                url: prefix + "/list",
                modalName: "销售统计",
                columns: [
                {
                    field: 'accountMonth',
                    title: '账期',
                },
                {
                    field: 'mount',
                    title: '数量'
                },
                {
                    field: 'goodsPrice',
                    title: '进价合计'
                },
                {
                    field: 'orderPrice',
                    title: '售价合计'
                },
                {
                    field: 'priceCount',
                    title: '盈利合计'
                }]
            };
            $.table.init(options);
        });

        function resetPre() {
            $("#formId")[0].reset();
            $("#select2-accountMonth-container").html("所有")
            $.table.search('formId', 'bootstrap-table');
        }

    </script>
</body>
</html>